package pearson.automation.forms.courseDetails;

import org.openqa.selenium.By;

import framework.BaseForm;
import framework.elements.Button;
import framework.elements.Label;

public class CourseReviewAndPublish extends BaseForm {

    private Button back =
        new Button(By.linkText("Back"), "Back");
    private static Button publish =
        new Button(By.linkText("Publish"), "Publish");
    
    private Label title       =
        new Label(By.xpath("(//dd)[1]"), "Title");
    private Label edition     =
        new Label(By.xpath("(//dd)[2]"), "Edition");
    private Label subject     =
        new Label(By.xpath("(//dd)[3]"), "Subject");
    private Label term        =
        new Label(By.xpath("(//dd)[4]"), "Term");
    private Label startDate   =
        new Label(By.xpath("(//dd)[5]"), "Start Date");
    private Label privacy     =
        new Label(By.xpath("(//dd)[6]"), "Privacy");
    private Label description =
        new Label(By.xpath("(//dd)[7]"), "Description");
    private Label tags        =
        new Label(By.xpath("(//dd)[8]"), "Tags");
    
    public CourseReviewAndPublish() {
        super(publish.getLocator(), "Preview");
    }

    public CoursePublishingDetails clickBack() {
        back.clickAndWait();
        return new CoursePublishingDetails();
    }
    
    public CoursePublishCongratulations clickPublish() {
        publish.clickAndWait();
        return new CoursePublishCongratulations();
    }
    
    public String getTitle() {
        return title.getText();
    }
    
    public String getEdition() {
        return edition.getText();
    }
    
    public String getSubject() {
        return subject.getText();
    }
    
    public String getTerm() {
        return term.getText();
    }

    public String getStartDate() {
        return startDate.getText();
    }
    
    public String getPrivacy() {
        return privacy.getText();
    }
    
    public String getDescription() {
        return description.getText();
    }
    
    public String getTags() {
        return tags.getText();
    }
    
}
